#ifndef _STATEMANIPULATOR_H_
#define _STATEMANIPULATOR_H_
#include "Opencv.h"
#include <cstdlib>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <time.h>
/* #include <RandomLib/Random.hpp> */
/* #include <RandomLib/NormalDistribution.hpp> */
/* #include <RandomLib/RandomSelect.hpp> */


class stateManipulator
{
 public:
  //RandomLib::Random ran;
  int currentState;
  vector< vector< double > > probabilityMap;
  vector<int> aliasVec;
 public:
  //  stateManipulator(int in)
  stateManipulator()
    {
      //ran.Reseed();
      srand((unsigned int)time(NULL));
      currentState = 0;
      /* initProbabilityMap(in); */
      /* initAliasVector(in); */
    }

  void initProbabilityMap(int in);

  void initAliasVector(int in);

  int translateIndex(int index);

  void setAliasVector(vector<int> set);

  void showAliasVector();

  void setProbability(int from, int to, double probability);

  double getProbability(int from, int to);

  void setProbabilityEach(int a, int b, double probability);

  void showProbabilityMap();

  void setCurrentState(int state);

  int getCurrentState();

  bool stateChenge(int to);

  double getRandNum();

};


#endif
